import { http } from '@/utils/http'
import { AddCardParams, SelectedCarParams } from './type'
// 添加购物车
export const addCar = (p: AddCardParams) => http.post('/shopapi/cart/add', p)

// 购物车列表
export const fetchCarList = (p: Pagination) => http.get('/shopapi/cart/lists', p)

// 选中购物车
export const selectedCar = (p: SelectedCarParams) => http.post('/shopapi/cart/selected', p)

// 获取购物车结算信息
export const fetchSettlementInfo = () => http.get('/shopapi/cart/num')

// 删除购物车
export const removeCar = (cart_id: string | string[]) => http.post('/shopapi/cart/del', { cart_id })
